import request from 'src/axios'

/**
 * @description 根据条码规则查询规则明细
 * @param { String } barcodeId 规则主键
 * @returns Promise
 */
export const listBarcodeRule = (barcodeId: string) => {
  return request.get('/system/barcode/rule/list', { params: { barcodeId } })
}

/**
 * @description 查看条码规则明细
 * @param { String } id 主键
 * @returns Promise
 */
export const viewBarcodeRule = (id: string) => {
  return request.get('/system/barcode/rule', { params: { id } })
}

/**
 * @description 新增条码规则明细
 * @param { Object } data 新增数据
 * @returns Promise
 */
export const saveBarcodeRule = (data: object) => {
  return request.post('/system/barcode/rule', data)
}

/**
 * @description 修改条码规则明细
 * @param { Object } data 修改数据
 * @returns Promise
 */
export const updateBarcodeRule = (data: object) => {
  return request.put('/system/barcode/rule', data)
}

/**
 * @description 删除条码规则明细
 * @param { Array<string> } ids 主键数组
 * @returns Promise
 */
export const deleteBarcodeRule = (ids: Array<string>) => {
  return request.delete('/system/barcode/rule', { data: ids })
}
